﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WZXC_GBL_QUERY
{
    public partial class Form_DayMaxMin : Form
    {
        Dictionary<int,PVMaxMin>  _maxmin;
        public Form_DayMaxMin(Dictionary<int,PVMaxMin> pvmaxmin)
        {
            InitializeComponent();
            _maxmin = pvmaxmin;
        }


        private void btn_Close_Click(object sender , EventArgs e)
        {
            this.Dispose();
        }

        private void Form_DayMaxMin_Load(object sender , EventArgs e)
        {
            if (_maxmin == null || _maxmin.Count == 0) return;
            foreach (int id in _maxmin.Keys)
            {
                //lst_Alarm.Items.Add(new ListViewItem(new string[] { (lst_Alarm.Items.Count + 1).ToString() , dt.Rows[i]["AlarmName"].ToString() , dt.Rows[i]["AlarmLevel"].ToString() , "" , dt.Rows[i]["SaveTime"].ToString() }));//最后是报警等级，最后修改

                lst_maxmin.Items.Add(new ListViewItem(new string[] { 
                    _maxmin[id].zonename ,
                    _maxmin[id].max==0?"-": _maxmin[id].max.ToString(),
                    _maxmin[id].maxtime.ToString(),
                    _maxmin[id].min==9999f?"-": _maxmin[id].min.ToString(),
                    _maxmin[id].mintime.ToString() 
                }));
            }
        }
    }
}
